package com.midou.administration.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.midou.administration.entity.Role;
import com.midou.administration.mapper.RoleMapper;
import com.midou.administration.entity.Role;
import com.midou.administration.mapper.RoleMapper;
import com.midou.administration.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MrChen
 * @since 2021-03-24
 */
@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;
    public List<Role> allRole(Integer bid){
        return roleMapper.allRole(bid);
    }

    public Role queryRole(Integer id){
        QueryWrapper qw = new QueryWrapper();
        qw.eq("role_id",id);
        return roleMapper.selectOne(qw);
    }

    @Override
    public List<Role> queryRoleFunction(Integer bid) {
        return roleMapper.queryRoleFunction(bid);
    }

}
